/*
 * @Author: 陈宇环
 * @Date: 2023-10-30 17:22:57
 * @LastEditTime: 2023-10-31 10:33:10
 * @LastEditors: 陈宇环
 * @Description: 标题
 */
import { defineComponent, PropType } from 'vue'
import type { titleProps } from '../interface'
import styles from '@/components/BsForm/style.module.scss'

export default defineComponent({
  name: 'BsCollapse',
  props: {
    modelValue: {
      type: [Number, String, Array, Object, Boolean],
      default: undefined,
    },
    config: {
      type: Object as PropType<titleProps>,
      default() {
        return {}
      },
    },
  },
  setup(props: any) {
    return () => {
      return (
        <div class={['bs-title', styles.BaseTitle]} style={{ width: '100%' }} {...props.config.nativeProps}>
          <div>
            {
              props.config.render ? props.config.render() :
                <div style={{ background: '#f1f1f1', padding: '5px 10px', fontWeight: 'bold' }}>{ props.config.title }</div>
            }
          </div>
        </div>
      )
    }
  },
})
export { titleProps }
